Copyright: Visual Help Copyright® 1993 Firas Bushnaq


CONTENTS
Alternative SETUP.EXE Version 1.1

Why another setup.exe?

What´s new in Version 1.1

Installation

Preparing setup.ini

Preparing the installation master disks

And this is how it works...

(c) 1994 by

Mey & Westphal
RIPOSTE Software GbR
Schottweg 1
22087 Hamburg
Germany

Tel +49 (0)40 22 17 23
Fax +49 (0)40 22 17 72
CIS 100111,305

Registration

Registration for setup.exe is available through the CompuServe SWREG forum.

Registration ID: 3302
Registration fee: $18 + s/h


WHY ANOTHER SETUP.EXE
Why another setup.exe?

For the poor man problems with installation routines seemingly never will cease to crop up. Mostly it´s just hard to find the right files to put on your master installation disks. At other times the installation disks your customers received won´t install at all.

The first problem Microsoft tried to address (for the Visual Basic programmer community) with its Setup Wizard included in the VB 3.0 version. Judge for yourself how good it´s doing its job.

The latter problem this alternative setup.exe is supposed to tackle. Its main advantages over other setup.exe programs are:

1	It creates a temporary directory for all files needed for the main installation routine. Thus neither the windows nor the system directory gets cluttered.

2	It just relies on the presence of lzexpand.dll on the target system. It doesn´t require ver.dll, neither on the target system nor on the installation master disks.

3	It´s customizable in terms of message language, windowstate of main setup program etc.

4	Works with other VB programs running during installation.

5	It´s very simple to use!


WHAT IS NEW
What´s new in Version 1.1

•	Bugfix: if your main installation program was already present in the Windows/System directory on the target system during installation, setup.exe would not have installed it properly from disk.

•	setup.exe now passes the whole source path to the main installation program, not just the source drive.

•	setup.exe now passes on all command line parameters to the main installation program. This allows you to run setup routines in an automatic or batch mode.

•	setup.exe hides its message box after having called the main setup program.

•	setup.exe no longer changes the current drive/path during installation.

•	You can determine the windowstate of the main setup program when it´s run, e.g. maximized.


Installation

Installing setup.exe is very simple:

1	Copy setup.exe to any directory you wish. Just keep in mind where you put it.

2	If you are mostly using the same main setup program, e.g. setup1.exe from the VB 3.0 package, prepare the setup.ini file as described below and put it in the same directory as setup.exe.

That´s it.

Most of your concentration is needed when putting together the setup.ini file which drives the installation bootstrap process initiated by starting setup.exe.

See also:

Preparing setup.ini

Requirements

•	Windows 3.1 or higher must be present on the target system.

•	lzexpand.dll must be present on the target system.

Limitations

•	There sometimes seems to be a problem when running setup.exe from a Windows NT environment.
Unfortunately this could not be reproduced on. We are working on it. If you are experiencing this error, let us know if you have gained some insights into the exact circumstances under wihich it occures.


SETUP.INI
Preparing setup.ini

When setup.exe is started its job is to prepare an environment that allows your main setup program to run properly. So what it needs most is a list of files to copy to the temporary directory and a pointer to which of the files is your main setup program to start afterwards. All this information and more has to be put in the setup.ini file.

Following is a description of all the INI-file sections with examples:

[System]

windowstate=3

´windowstate´ determines how the main setup program will be startet by setup.exe, i.e. with a maximized windows (3), a minimized window (2) or normal (1).

[Dialog]

Caption=My Application
Message=Initializing my main setup program...

This section defines the contents of the small dialog box appearing when setup.exe is startet. ´Caption´ sets the caption of the dialog box and ´message´ will be displayed as one line of text within the dialog box.

[Errormessages]

Err0=Full path of temp dir too long.
Err1=Unable to create temp dir.
Err2=%s : Unable to run main install program from temp dir.
Err3=%s : Unable to copy file from installation drive to temp dir.
Err6=Not enough resources to run main installation program.

To make setup.exe even more customizable you can define messages for every error condition trapped by the program. If no error message is provided by you, setup.exe will come up with an English one.
If ´%s´ is used within a message text it will be replaced by a string relevant to the specific error, e.g. a filename. (Be carefull to use ´%s´ only as listed above, not every message supports the ´%s´ parameter.)

Err4 & Err5 have been discarded. For compatibility reasons the resulting gap hasn´t been filled.

[Files]

setup1.exe=
setupkit.dl_=setupkit.dll

This certainly is the most important section of setup.ini. Here you define which files to copy initially to the target system in order to start the main setup program. The rules for the section entries are very simple:

1	The first entry must be your main setup program. After all files have been copied by setup.exe it will be run and is responsible for installing your application properly.

2	Each section entry has the form:

           source filename = destination filename

- Naming a destination filename is optional; but you must always put a ´=´ after the source filename.

- No destination filename must be given for the main setup program.

- If setup.exe could not find the source file it will try again after replacing the last character of the extension with a ´_´. So if you compressed your files using compress.exe with the ´-r´ switch you don´t have to worry about the extension in the source filename. Example:
           myfile.ex_=myfile.exe       is the same as
           myfile.exe=

3	All files must reside in the same directory as setup.exe. No path is allowed in the source/destination filename.


PREPARING THE MASTER DISKS
Preparing the installation master disks

So finally you have finished your application and you want to put together your installation master disks.

1	Copy all the application files to your set of master disks.

2	Determine the files required by your main setup program, e.g. setup1.exe, setupkit.dll, ver.dll, vbrun300.dll etc.

3	Copy the above files to the first installation master disk. Either compress them while copying (using compress.exe) or copy them as is.

4	List all the above files in the [Files] section of your setup.ini file. Make the first entry your main setup program. e.g. setup1.exe.

5	Copy setup.exe and the adapted setup.ini file to the first installation master disk.

That´s it.

For details on how to customize setup.ini to your needs see also:

Preparing setup.ini


HOW IT WORKS
And this is how it works...

This is a quick description on how setup.exe does its job:

1	Start setup.exe from the program manager or by doubleclicking on it in the file manager. setup.exe and all the other files may either reside on floppies or in a hard disk directory.
Any parameters you pass to it will be passed to the main setup program (see below)!

2	setup.exe then creates a temporary directory within the current user´s Windows directory.

3	All files listed in the [Files] section will be copied to the temporary directory.

4	setup.exe will try to run the first file listed in the [Files] section, e.g.

[Files]
setup1.exe=
setupkit.dll=
...

will result in running setup1.exe with a couple of command line parameters:

setup1.exe A: param1 param2 ...

'A:' in this case stands for the source directory during the installation process. param1 etc. stands for any command line parameters you passed to setup.exe.

setup.exe will NOT make the temporary directory the current directory during installation! So from within a VB program you can access files by prepending   app.path & "\"   to any filename.

5	setup.exe will wait in the background for your main setup program to finish execution and afterwards delete the temporary directory and its contents.

Since a directory must be empty before deleting it, setup.exe first will remove all files it had copied to the temporary directory - no more, no less. So be careful to delete your ´personal´ stuff (e.g. files created by the main setup program during the course of the installation) from the temp dir if you want setup.exe to be able to remove the temp dir.